#ifndef UI_COLORBOX_H
#define UI_COLORBOX_H

#include <qcombobox.h>

#include "pf_color.h"
#include "gui_export.h"

/**
 * A combobox for choosing a color.
 */
class GUI_EXPORT UI_ColorBox: public QComboBox {
    Q_OBJECT

public:
    UI_ColorBox(QWidget* parent=0, const char* name=0);
    UI_ColorBox(bool showByLayer, bool showUnchanged, 
		QWidget* parent=0, const char* name=0);
    virtual ~UI_ColorBox();

    PF_Color getColor() {
        return currentColor;
    }

    void setColor(const PF_Color& color);
    void setLayerColor(const PF_Color& color);

    void init(bool showByLayer, bool showUnchanged);

	bool isUnchanged() {
		return unchanged;
	}

private slots:
    void slotColorChanged(int index);

signals:
    void colorChanged(const PF_Color& color);

private:
    PF_Color currentColor;
    bool showByLayer;
	bool showUnchanged;
	bool unchanged;
};

#endif

